package com.example.demo.Controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@ResponseBody
public class LogController {

    //1.获取日志对象
    private static Logger log = LoggerFactory.getLogger(LogController.class);

    @RequestMapping("/log")
    public void doLog() {
        String msg = "今天星期天，不是摆烂的一天";
        log.trace("trace -> " + msg);
        log.debug("debug -> " + msg);
        log.info("info -> " + msg);
        log.warn("warn -> " + msg);
        log.error("error -> " + msg);
    }
}
